package com.ruoyi.web.config;

import cloud.tianai.captcha.common.constant.CaptchaTypeConstant;
import cloud.tianai.captcha.resource.ResourceStore;
import cloud.tianai.captcha.resource.common.model.dto.Resource;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 图形验证码配置
 * <a href="https://gitee.com/tianai/tianai-captcha-demo">...</a>
 *
 * @author Tellsea
 * @date 2024-09-01
 */
@Component
@RequiredArgsConstructor
public class TianaiCaptchaResourceConfig {

    private final ResourceStore resourceStore;

    @PostConstruct
    public void init() {
        resourceStore.addResource(CaptchaTypeConstant.SLIDER, new Resource("classpath", "tianai-captcha/1.jpg", "default"));
    }
}